package net.sourceforge.javaocr.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Logger;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class OCRMenuBar extends JMenuBar
{

    public static final long serialVersionUID = 0;
    private final GUIController guiController;

    public OCRMenuBar(GUIController guiController)
    {
        this.guiController = guiController;

        //Add File Menu
        addFileMenu();

    }

    private void addFileMenu()
    {
        JMenu fileMenu = new JMenu("Archivo");
        JMenuItem exitBtn = new JMenuItem("Salir");
        exitBtn.addActionListener(getExitBtnListener());
        fileMenu.add(exitBtn);
        this.add(fileMenu);
    }


    private ActionListener getExitBtnListener()
    {
        return new ActionListener()
        {

            public void actionPerformed(ActionEvent e)
            {
                System.exit(0);
            }
        };
    }

	public GUIController getGuiController() {
		return guiController;
	}
	
	@SuppressWarnings("unused")
	private static final Logger LOG = Logger.getLogger(OCRMenuBar.class.getName());
}
